.class public final Lcom/burstly/lib/component/networkcomponent/burstly/html/BurstlyScriptAdaptor;
.super Ljava/lang/Object;
.source "BurstlyScriptAdaptor.java"

# interfaces
.implements Lcom/burstly/lib/component/IBurstlyAdaptor;
.implements Lcom/burstly/lib/component/IClickTracker;


# static fields
.field public static final NETWORK_NAME:Ljava/lang/String; = "burstlyScript"


# instance fields
.field private final mBurstlyViewId:Ljava/lang/String;

.field private mComponentState:Lcom/burstly/lib/component/ComponentState;

.field private mContext:Landroid/content/Context;

.field private mCurrentAdaptor:Lcom/burstly/lib/component/networkcomponent/burstly/AbstractBurstlyAdaptor;


# direct methods
.method public constructor <init>(Landroid/content/Context;Ljava/lang/String;)V
    .locals 0
    .parameter "context"
    .parameter "viewId"

    .prologue
    .line 70
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 71
    iput-object p2, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/BurstlyScriptAdaptor;->mBurstlyViewId:Ljava/lang/String;

    .line 72
    iput-object p1, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/BurstlyScriptAdaptor;->mContext:Landroid/content/Context;

    .line 73
    return-void
.end method


# virtual methods
.method public destroy()V
    .locals 2

    .prologue
    const/4 v1, 0x0

    .line 122
    iget-object v0, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/BurstlyScriptAdaptor;->mCurrentAdaptor:Lcom/burstly/lib/component/networkcomponent/burstly/AbstractBurstlyAdaptor;

    invoke-virtual {v0}, Lcom/burstly/lib/component/networkcomponent/burstly/AbstractBurstlyAdaptor;->destroy()V

    .line 123
    iput-object v1, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/BurstlyScriptAdaptor;->mContext:Landroid/content/Context;

    .line 124
    iput-object v1, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/BurstlyScriptAdaptor;->mComponentState:Lcom/burstly/lib/component/ComponentState;

    .line 125
    return-void
.end method

.method public endTransaction(Lcom/burstly/lib/component/IBurstlyAdaptor$TransactionCode;)V
    .locals 1
    .parameter "endCode"

    .prologue
    .line 172
    iget-object v0, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/BurstlyScriptAdaptor;->mCurrentAdaptor:Lcom/burstly/lib/component/networkcomponent/burstly/AbstractBurstlyAdaptor;

    invoke-virtual {v0, p1}, Lcom/burstly/lib/component/networkcomponent/burstly/AbstractBurstlyAdaptor;->endTransaction(Lcom/burstly/lib/component/IBurstlyAdaptor$TransactionCode;)V

    .line 173
    return-void
.end method

.method public endViewSession()V
    .locals 1

    .prologue
    .line 157
    iget-object v0, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/BurstlyScriptAdaptor;->mCurrentAdaptor:Lcom/burstly/lib/component/networkcomponent/burstly/AbstractBurstlyAdaptor;

    invoke-virtual {v0}, Lcom/burstly/lib/component/networkcomponent/burstly/AbstractBurstlyAdaptor;->endViewSession()V

    .line 158
    return-void
.end method

.method public getAdType()Lcom/burstly/lib/component/IBurstlyAdaptor$BurstlyAdType;
    .locals 1

    .prologue
    .line 117
    iget-object v0, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/BurstlyScriptAdaptor;->mCurrentAdaptor:Lcom/burstly/lib/component/networkcomponent/burstly/AbstractBurstlyAdaptor;

    invoke-virtual {v0}, Lcom/burstly/lib/component/networkcomponent/burstly/AbstractBurstlyAdaptor;->getAdType()Lcom/burstly/lib/component/IBurstlyAdaptor$BurstlyAdType;

    move-result-object v0

    return-object v0
.end method

.method public getNetworkName()Ljava/lang/String;
    .locals 1

    .prologue
    .line 107
    const-string v0, "burstlyScript"

    return-object v0
.end method

.method public getNewAd()Landroid/view/View;
    .locals 1

    .prologue
    .line 97
    iget-object v0, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/BurstlyScriptAdaptor;->mCurrentAdaptor:Lcom/burstly/lib/component/networkcomponent/burstly/AbstractBurstlyAdaptor;

    invoke-virtual {v0}, Lcom/burstly/lib/component/networkcomponent/burstly/AbstractBurstlyAdaptor;->getNewAd()Landroid/view/View;

    move-result-object v0

    return-object v0
.end method

.method public getResponseHandler()Lcom/burstly/lib/component/ITrackClickResponseHandler;
    .locals 1

    .prologue
    .line 177
    iget-object v0, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/BurstlyScriptAdaptor;->mCurrentAdaptor:Lcom/burstly/lib/component/networkcomponent/burstly/AbstractBurstlyAdaptor;

    invoke-virtual {v0}, Lcom/burstly/lib/component/networkcomponent/burstly/AbstractBurstlyAdaptor;->getResponseHandler()Lcom/burstly/lib/component/ITrackClickResponseHandler;

    move-result-object v0

    return-object v0
.end method

.method public pause()V
    .locals 1

    .prologue
    .line 129
    iget-object v0, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/BurstlyScriptAdaptor;->mCurrentAdaptor:Lcom/burstly/lib/component/networkcomponent/burstly/AbstractBurstlyAdaptor;

    invoke-virtual {v0}, Lcom/burstly/lib/component/networkcomponent/burstly/AbstractBurstlyAdaptor;->pause()V

    .line 130
    return-void
.end method

.method public precacheAd()Landroid/view/View;
    .locals 1

    .prologue
    .line 102
    iget-object v0, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/BurstlyScriptAdaptor;->mCurrentAdaptor:Lcom/burstly/lib/component/networkcomponent/burstly/AbstractBurstlyAdaptor;

    invoke-virtual {v0}, Lcom/burstly/lib/component/networkcomponent/burstly/AbstractBurstlyAdaptor;->precacheAd()Landroid/view/View;

    move-result-object v0

    return-object v0
.end method

.method public precacheInterstitialAd()V
    .locals 1

    .prologue
    .line 162
    iget-object v0, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/BurstlyScriptAdaptor;->mCurrentAdaptor:Lcom/burstly/lib/component/networkcomponent/burstly/AbstractBurstlyAdaptor;

    invoke-virtual {v0}, Lcom/burstly/lib/component/networkcomponent/burstly/AbstractBurstlyAdaptor;->precacheInterstitialAd()V

    .line 163
    return-void
.end method

.method public resume()V
    .locals 1

    .prologue
    .line 142
    iget-object v0, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/BurstlyScriptAdaptor;->mCurrentAdaptor:Lcom/burstly/lib/component/networkcomponent/burstly/AbstractBurstlyAdaptor;

    invoke-virtual {v0}, Lcom/burstly/lib/component/networkcomponent/burstly/AbstractBurstlyAdaptor;->resume()V

    .line 143
    return-void
.end method

.method public setAdaptorListener(Lcom/burstly/lib/component/IBurstlyAdaptorListener;)V
    .locals 1
    .parameter "listener"

    .prologue
    .line 147
    iget-object v0, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/BurstlyScriptAdaptor;->mCurrentAdaptor:Lcom/burstly/lib/component/networkcomponent/burstly/AbstractBurstlyAdaptor;

    invoke-virtual {v0, p1}, Lcom/burstly/lib/component/networkcomponent/burstly/AbstractBurstlyAdaptor;->setAdaptorListener(Lcom/burstly/lib/component/IBurstlyAdaptorListener;)V

    .line 148
    return-void
.end method

.method public showPrecachedInterstitialAd()V
    .locals 1

    .prologue
    .line 167
    iget-object v0, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/BurstlyScriptAdaptor;->mCurrentAdaptor:Lcom/burstly/lib/component/networkcomponent/burstly/AbstractBurstlyAdaptor;

    invoke-virtual {v0}, Lcom/burstly/lib/component/networkcomponent/burstly/AbstractBurstlyAdaptor;->showPrecachedInterstitialAd()V

    .line 168
    return-void
.end method

.method public startTransaction(Ljava/util/Map;)V
    .locals 4
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/Map",
            "<",
            "Ljava/lang/String;",
            "*>;)V"
        }
    .end annotation

    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/lang/IllegalArgumentException;
        }
    .end annotation

    .prologue
    .line 77
    .local p1, paramsFromServer:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/String;*>;"
    const-string v1, "componentState"

    invoke-interface {p1, v1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/burstly/lib/component/ComponentState;

    iput-object v1, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/BurstlyScriptAdaptor;->mComponentState:Lcom/burstly/lib/component/ComponentState;

    .line 78
    iget-object v1, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/BurstlyScriptAdaptor;->mComponentState:Lcom/burstly/lib/component/ComponentState;

    invoke-virtual {v1}, Lcom/burstly/lib/component/ComponentState;->getResponseData()Lcom/burstly/lib/network/beans/ResponseBean$ResponseData;

    move-result-object v1

    invoke-virtual {v1}, Lcom/burstly/lib/network/beans/ResponseBean$ResponseData;->getAdType()Lcom/burstly/lib/network/beans/ResponseBean$ResponseData$AdType;

    move-result-object v0

    .line 83
    .local v0, adType:Lcom/burstly/lib/network/beans/ResponseBean$ResponseData$AdType;
    iget-object v1, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/BurstlyScriptAdaptor;->mComponentState:Lcom/burstly/lib/component/ComponentState;

    invoke-virtual {v1}, Lcom/burstly/lib/component/ComponentState;->getResponseData()Lcom/burstly/lib/network/beans/ResponseBean$ResponseData;

    move-result-object v1

    invoke-virtual {v1}, Lcom/burstly/lib/network/beans/ResponseBean$ResponseData;->getDataType()Ljava/lang/Integer;

    move-result-object v1

    invoke-static {v1}, Lcom/burstly/lib/util/Utils;->isRewards(Ljava/lang/Integer;)Z

    move-result v1

    if-eqz v1, :cond_0

    .line 84
    new-instance v1, Lcom/burstly/lib/component/networkcomponent/burstly/html/RewardsScriptAdaptor;

    iget-object v2, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/BurstlyScriptAdaptor;->mContext:Landroid/content/Context;

    iget-object v3, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/BurstlyScriptAdaptor;->mBurstlyViewId:Ljava/lang/String;

    invoke-direct {v1, v2, v3}, Lcom/burstly/lib/component/networkcomponent/burstly/html/RewardsScriptAdaptor;-><init>(Landroid/content/Context;Ljava/lang/String;)V

    iput-object v1, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/BurstlyScriptAdaptor;->mCurrentAdaptor:Lcom/burstly/lib/component/networkcomponent/burstly/AbstractBurstlyAdaptor;

    .line 92
    :goto_0
    iget-object v1, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/BurstlyScriptAdaptor;->mCurrentAdaptor:Lcom/burstly/lib/component/networkcomponent/burstly/AbstractBurstlyAdaptor;

    invoke-virtual {v1, p1}, Lcom/burstly/lib/component/networkcomponent/burstly/AbstractBurstlyAdaptor;->startTransaction(Ljava/util/Map;)V

    .line 93
    return-void

    .line 85
    :cond_0
    invoke-static {v0}, Lcom/burstly/lib/util/Utils;->isOrmma(Lcom/burstly/lib/network/beans/ResponseBean$ResponseData$AdType;)Z

    move-result v1

    if-eqz v1, :cond_1

    .line 86
    new-instance v1, Lcom/burstly/lib/component/networkcomponent/burstly/html/OrmmaBurstlyScriptAdaptor;

    iget-object v2, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/BurstlyScriptAdaptor;->mContext:Landroid/content/Context;

    iget-object v3, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/BurstlyScriptAdaptor;->mBurstlyViewId:Ljava/lang/String;

    invoke-direct {v1, v2, v3}, Lcom/burstly/lib/component/networkcomponent/burstly/html/OrmmaBurstlyScriptAdaptor;-><init>(Landroid/content/Context;Ljava/lang/String;)V

    iput-object v1, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/BurstlyScriptAdaptor;->mCurrentAdaptor:Lcom/burstly/lib/component/networkcomponent/burstly/AbstractBurstlyAdaptor;

    goto :goto_0

    .line 87
    :cond_1
    invoke-static {v0}, Lcom/burstly/lib/util/Utils;->isMraid(Lcom/burstly/lib/network/beans/ResponseBean$ResponseData$AdType;)Z

    move-result v1

    if-eqz v1, :cond_2

    .line 88
    new-instance v1, Lcom/burstly/lib/component/networkcomponent/burstly/html/MraidBurstlyScriptAdaptor;

    iget-object v2, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/BurstlyScriptAdaptor;->mContext:Landroid/content/Context;

    iget-object v3, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/BurstlyScriptAdaptor;->mBurstlyViewId:Ljava/lang/String;

    invoke-direct {v1, v2, v3}, Lcom/burstly/lib/component/networkcomponent/burstly/html/MraidBurstlyScriptAdaptor;-><init>(Landroid/content/Context;Ljava/lang/String;)V

    iput-object v1, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/BurstlyScriptAdaptor;->mCurrentAdaptor:Lcom/burstly/lib/component/networkcomponent/burstly/AbstractBurstlyAdaptor;

    goto :goto_0

    .line 90
    :cond_2
    new-instance v1, Lcom/burstly/lib/component/networkcomponent/burstly/html/BurstlyBaseScriptAdaptor;

    iget-object v2, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/BurstlyScriptAdaptor;->mContext:Landroid/content/Context;

    iget-object v3, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/BurstlyScriptAdaptor;->mBurstlyViewId:Ljava/lang/String;

    invoke-direct {v1, v2, v3}, Lcom/burstly/lib/component/networkcomponent/burstly/html/BurstlyBaseScriptAdaptor;-><init>(Landroid/content/Context;Ljava/lang/String;)V

    iput-object v1, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/BurstlyScriptAdaptor;->mCurrentAdaptor:Lcom/burstly/lib/component/networkcomponent/burstly/AbstractBurstlyAdaptor;

    goto :goto_0
.end method

.method public startViewSession()V
    .locals 1

    .prologue
    .line 152
    iget-object v0, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/BurstlyScriptAdaptor;->mCurrentAdaptor:Lcom/burstly/lib/component/networkcomponent/burstly/AbstractBurstlyAdaptor;

    invoke-virtual {v0}, Lcom/burstly/lib/component/networkcomponent/burstly/AbstractBurstlyAdaptor;->startViewSession()V

    .line 153
    return-void
.end method

.method public stop()V
    .locals 1

    .prologue
    .line 135
    iget-object v0, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/BurstlyScriptAdaptor;->mCurrentAdaptor:Lcom/burstly/lib/component/networkcomponent/burstly/AbstractBurstlyAdaptor;

    if-eqz v0, :cond_0

    .line 136
    iget-object v0, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/BurstlyScriptAdaptor;->mCurrentAdaptor:Lcom/burstly/lib/component/networkcomponent/burstly/AbstractBurstlyAdaptor;

    invoke-virtual {v0}, Lcom/burstly/lib/component/networkcomponent/burstly/AbstractBurstlyAdaptor;->stop()V

    .line 138
    :cond_0
    return-void
.end method

.method public supports(Ljava/lang/String;)Z
    .locals 1
    .parameter "action"

    .prologue
    .line 112
    iget-object v0, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/BurstlyScriptAdaptor;->mCurrentAdaptor:Lcom/burstly/lib/component/networkcomponent/burstly/AbstractBurstlyAdaptor;

    invoke-virtual {v0, p1}, Lcom/burstly/lib/component/networkcomponent/burstly/AbstractBurstlyAdaptor;->supports(Ljava/lang/String;)Z

    move-result v0

    return v0
.end method
